//
//  UIImage+XL.m
//  Weibo
//
//  Created by wpapple on 16/5/31.
//  Copyright © 2016年 红红火火恍恍惚惚嘿嘿嘿. All rights reserved.
//

#import "UIImage+XL.h"

@implementation UIImage (XL)

+(UIImage *)resizableImage:(NSString *)imageName{
    UIImage * image = [UIImage imageNamed:imageName];
    UIEdgeInsets edgeInsets = UIEdgeInsetsMake(image.size.height/2, image.size.width/2, image.size.height/2, image.size.width/2);
    UIImage * newImage = [image resizableImageWithCapInsets:edgeInsets resizingMode:UIImageResizingModeStretch];
    return newImage;
}

+(UIImage *)resizableImage:(NSString *)imageName withEdgeInsets:(UIEdgeInsets)edgeInsets{
    UIImage * image = [UIImage imageNamed:imageName];
    UIImage * newImage = [image resizableImageWithCapInsets:edgeInsets resizingMode:UIImageResizingModeStretch];
    return newImage;
}

@end
